package com.example.common.adapter

import android.widget.ImageView
import androidx.databinding.BindingAdapter
import com.example.image.glide.GlideImgLoader

/**
 * DataBindAdapter
 */
object CommonBindAdapter{
    @BindingAdapter("imageUrl")
    fun loadUrlImage(iv:ImageView,url:String){
        if (!url.isNullOrEmpty()){
            GlideImgLoader.loadImage(iv.context,url,iv)
        }
    }
    @BindingAdapter("imageCircleUrl")
    fun loadUrlCircleImage(iv:ImageView,url:String){
        if (!url.isNullOrEmpty()){
            GlideImgLoader.loadCircleImage(iv.context,url,iv)
        }
    }
}